<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>重量区间管理导入帮助</title>
    <script src="../assets/js/jquery-1.10.2.js"></script>
    <style type="text/css">
          #supplier,#settlementregion{
            width: 300px;
            height:50px;
              text-align: center;
              border: solid;
        }
    </style>
</head>
<body>
        <row>
            <h3 style="color:red;">注意</h3>
            <span>
                根据头部名字匹配值导入数据，所以模板的头部名字一定不能变
            </span>
        </row>
        <row>
            <h3>配送类型</h3>
            <table border="2">
                <thead><tr><th colspan="3">所有取值</th></thead>
                <thead align="center"><th>配送</th><th>上门退</th><th>上门换</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>供应商名称</h3>
            <select id="supplier"></select>
        </row>
        <row>
            <h3>结算区域</h3>
            <select id="settlementregion"></select>
        </row>
</body>
<script>
    $(document).ready(function () {
        supplierNames('../system/supplier/listall');
        settlementRegions('../rule/settlementregion/listall');
    });
    function supplierNames(url) {
            $.ajax({
                url :url,
                type : 'POST',
                dataType : "json",
                success : function(result) {
                    var data=result.data||[];
                    var bb =$(document).find("#supplier");
                    for ( var i in data) {
                        bb.append("<option value='"+data[i].name+"'>"+ data[i].name+ "</option>");
                    }
                }
            });
    }
    function settlementRegions(url) {
         $.ajax({
             url:url,
             type:'POST',
             dataType:"json",
             success:function (result) {
                 var data = result.data||[];
                 var  bb = $(document).find("#settlementregion");
                 for(var i in data){
                     bb.append("<option value='"+data[i].name+"'>"+data[i].name+"</option>");
                 }

             }
         });
    }

</script>
</html>